package com.spm.librarianmanagersystem.mapper;

import com.spm.librarianmanagersystem.pojo.Member;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Select;

@Mapper
@Repository
public interface MemberMapper {
    Member getMemberByID(String account);

    Boolean updateUserProfile(Integer user_id, String id,String password,String name,
                              Integer gender, Integer position,
                              String email, String phone_number);

    Boolean addMember(String id,String password,String name,
                      Integer gender, Integer position,
                      String email, String phone_number);

    Boolean deleteMyself(String currentUserId);

    Integer getUserIDByID(String currentUserId);
    
    @Select("Select email From member Where id = #{currentUserId}")
    String getEmailByID(String currentUserId);

    @Select("SELECT * FROM member WHERE user_id=#{userId}")
    Member getMemberByUserId(Integer userId);

    @Select("SELECT * FROM member WHERE email=#{email}")
    Member getMemberByEmail(String email);

    Integer getReaderNum();

    void updateReputation(Integer user_id,Integer ReputationScore);



}
